package com.wys.ws_im.dao;

import com.wys.ws_im.entity.Message;
import org.beetl.sql.core.annotatoin.Param;
import org.beetl.sql.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author wys
 * created in 0:37 2019/4/16
 */
@Repository
public interface MessageDao extends BaseMapper<Message> {

    /**
     * 查看最新的20条消息
     * @param ulid
     * @return
     */
    List<Message> getMessages(@Param("ulid") Integer ulid);

    /**
     * 获取离线消息和前20条消息
     * @param ulid
     * @param count
     * @return
     */
    List<Message> getOfflineMessages(@Param("count") Integer count, @Param("ulid") Integer ulid);

    /**
     * 获取最后一天信息id
     * @param ulid
     * @param send_id
     * @return
     */
    Integer getLastReadMsgId(@Param("ulid") Integer ulid, @Param("send_id") Integer send_id);

}
